$(document).ready(function(){
	
	var items = $("ul.slide-item li");
	var pics = $("ul.slide-pic li");
	var infos = $("ul.slide-info li");
	var count = items.length;
	var current = 0;
	var intervalID = null;
	
	var stop = function() { window.clearInterval(intervalID); };
	
	var slide = function(opts) {
		if (opts) {
			current = opts.cur || 0;
		} else {
			current = (current >= (count - 1)) ? 0 : (++current);
		};
		items.removeClass("cur").eq(current).addClass("cur");
		pics.filter(":visible").fadeOut(300, function() {
			pics.eq(current).fadeIn(300);
		});
		infos.filter(":visible").fadeOut(300, function() {
			infos.eq(current).fadeIn(300);
		});		
	}; 
	
	var start = function() {
		stop();
		intervalID = window.setInterval(function() { slide(); }, 5000);
	}; 
	
	var itemMouseOver = function(target, its) {
		stop();
		var i = $.inArray(target, its);
		slide({ cur: i });
	}; 
	items.hover(function() { if($(this).attr('class')!='cur'){itemMouseOver(this, items); }else{stop();}}, start);
	
	pics.hover(stop, start);

	start();
}); 	
	